# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper

  def admin_block(&block)
    if admin?
      concat content_tag(:div, capture(&block), :class => 'admin'), block.binding
    end
  end

  def sidebar(&block)
    @blocks ||= []
    @blocks << capture(&block)
  end

  def show_sidebar
    @blocks.each do |block|                                    
      content_tag :div, block, :class => 'sideblock'
    end
  end
  
end
